Lining up columns in an HTML table
-
Greetings!
I have created a table to display our menu of services and prices — and would like to know how to line up the columns correctly. You can’t use spaces or tabs (obviously!) and I’m sure there is a code or trick.
Many thanks in advance for your thoughts.
(Services is the page!)
The blog I need help with is: (visible only to logged in users)
-
Hi there,
When making my own HTML tables I use this http://wpbtips.wordpress.com/2013/04/09/table-coding-for-wordpress-com-users/ so perhaps it will be helpful for you. If not go to http://www.w3schools.com/html/html_tables.asp -
Oh Rats! I just realized this is a CSS editing thread. Please forgive me for not noticing that. Another Volunteer or Staff will assist you – sorry. :(
-
Hi there, There are a couple of ways to do this, but probably the easiest at this point would be to set a percentage width for the first td price cell on each of your tables, which will force the rest of the price cells in the table to be that width. It would look something like this:
<td style="padding:5px; width: 25%;">$40+</td>By using a percentage width, the table will still adjust properly on narrower browser windows and devices.
-
Thank you, I’ll try that! And apologies for posting HTML questions in the CSS forum. I started doing this is CSS and it was suggested that HTML is better for this particular layout!
-
-
No worries, and you are welcome. It can be done with CSS, but the amount of work is about the same either way since you would have create the CSS rule and then add something like
class="price-tr"
or something like that to at least the first price opening tr tag in each table if you went the CSS route. -
- The topic ‘Lining up columns in an HTML table’ is closed to new replies.