Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-07-09 12:47:38

bcobb10b
Member
From: Sandy Springs GA
Registered: 2014-03-28
Posts: 77

HTML table column widths not respected in the contact form

I cannot get a table I added to the Backlight Contact page Main Copy area to respect specified column widths.  I gave up on my table and used table HTML code Matthew suggested in another (CE4) post.  Results were the same.

<table>
<col width="100">
  <col width="100">
<col width="30">

<tr>
    <td>20" X 30"</td>
    <td style="text-align:right;">$300</td>
    <td style="text-align:right;">$750</td>
</tr>
</table>

The table width stretches to fill the entire Main Copy area width, and looks rather silly.

Same with code from a w3schools example (used as a sanity check).  It works fine on their "try it" sample, limiting column widths to the specified values, but not on the Backlight contact page.  I have not tried adding a table to other pages.

Is there a way to cause this table to respect the specified width?

Thanks,

Bill

Offline

#2 2016-07-09 13:35:54

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML table column widths not respected in the contact form

Take a look at the compatibility note on this page: http://www.w3schools.com/tags/att_col_width.asp
The col width attribute is not supported in html5


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2016-07-09 13:38:14

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML table column widths not respected in the contact form


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2016-07-09 13:56:44

bcobb10b
Member
From: Sandy Springs GA
Registered: 2014-03-28
Posts: 77

Re: HTML table column widths not respected in the contact form

Tried it ... no love.  I changed the %s to narrow the table and it still filled the page.  See at:
http://www.kurtsalumni.com/contact/

What you will see is with this spec, tweaked from the example you referenced.

<table border="1" width="50%">
        <col style="width:20%">
        <col style="width:15%">
        <col style="width:15%">
        <thead>

Offline

#5 2016-07-09 14:05:17

bcobb10b
Member
From: Sandy Springs GA
Registered: 2014-03-28
Posts: 77

Re: HTML table column widths not respected in the contact form

I know tables are discouraged for formatting data because at times they don't scale well, but sometimes they are the only option.

I can live with the hand spaced names, email addresses and phone numbers on my contact page (spaced out using non-breaking spaces "&nbsp;"), but sometime in the future I will need to use a table.

Thanks for the input.

Bill

Offline

#6 2016-07-09 15:15:11

bcobb10b
Member
From: Sandy Springs GA
Registered: 2014-03-28
Posts: 77

Re: HTML table column widths not respected in the contact form

Matthew, after playing with tables in my Backlight site versus how they are handled in static sites, I now see why Backlight tables act the way they do.  Tables don't scale at all in normal sites, but in Backlight sites they scale nicely.  I would like to have tables that don't fill the entire width, but if that isn't possible without breaking their smooth scaling, it won't be worth it.  I will figure out ways to work with what you have given us.  Good job -- u da man!

Offline

#7 2016-07-09 16:17:10

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML table column widths not respected in the contact form

Hi Bill,

Basic markup for a table looks like this:

<table>

	<thead>
		<tr>
			<td>Column 01</td>
			<td>Column 02</td>
			<td>Column 03</td>
		</tr>		
	</thead>

	<tbody>

		<tr>
			<td>Col 01, Row 01</td>
			<td>Col 02, Row 01</td>
			<td>Col 03, Row 01</td>
		</tr>		

		<tr>
			<td>Col 01, Row 02</td>
			<td>Col 02, Row 02</td>
			<td>Col 03, Row 02</td>
		</tr>		

	</tbody>

</table>

If you'd then like to start specifying widths of things, you can do so like this:

<table style="max-width: 640px;">

	<thead>
		<tr>
			<td style="width: 50%;">Column 01</td>
			<td style="width: 25%;">Column 02</td>
			<td style="width: 25%;">Column 03</td>
		</tr>		
	</thead>

	<tbody>

		<tr>
			<td>Col 01, Row 01</td>
			<td>Col 02, Row 01</td>
			<td>Col 03, Row 01</td>
		</tr>		

		<tr>
			<td>Col 01, Row 02</td>
			<td>Col 02, Row 02</td>
			<td>Col 03, Row 02</td>
		</tr>		

	</tbody>

</table>

It is sufficient to set the width for columns only for the top-most cells, as the rest of the column with follow suit. Also remember that your column widths are based on 100% of the table. So if you set the table width as 50%, then the columns as 20%, 15% and 15% as in your original example, then your columns will only take half the width of the table -- the table will be 50% of its container, and your columns will fill only 50% of your table. Instead, the columns should tally up to a full 100%, as in my example above.

Cheers,
Matt


Matt

The Turning Gate, http://theturninggate.net

Offline

#8 2016-07-14 10:55:17

bcobb10b
Member
From: Sandy Springs GA
Registered: 2014-03-28
Posts: 77

Re: HTML table column widths not respected in the contact form

Thanks Matthew -- somehow I missed your post of 7/9 -- just saw it over in the Backlight Tips & Tricks section.  Your suggestion of 7/9 works like a charm!

Very happy with the new product no issues with the latest release so far.  Enjoy your time away.

- Bill

Offline

#9 2016-07-14 14:17:56

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML table column widths not respected in the contact form

Glad to hear, Bill! We mostly hear issues here in the forum, so it's always good to hear that people are running smoothly.


Matt

The Turning Gate, http://theturninggate.net

Offline

Board footer

Powered by FluxBB