Solved

Change # of columns and with in a table

Posted on 2014-09-06
4
109 Views
Last Modified: 2014-09-07
Is there a way to have a table that has 10 columns and the last row only has 4?
I'm trying to center the 4 buttons at the end of the table.
For eample:
|-------------------------------------------------------------------------------------------------------------|
|col1         |col2       |col3     |col4     |col5    |col6    |col7    |col8    |col9    |col10   |
|                                                                                                                                         | 
|               |button1|                |button2|             |button3|             |button4|           |
|-------------------------------------------------------------------------------------------------------------|

Open in new window


It would be easy if all the columns were the same size, but they are not.
0
Comment
Question by:breeze351
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40307841
Use in each cell of the last row
colspan=""

Though 4 will not go into 10 so you would end with something like 2,2,3,3
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40307859
Use CSS to style div elements.  Tables made sense in 1996 before we had good browser support for CSS.
http://www.w3schools.com/css/
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40307954
Ray may or may not be right.  If the table is presenting tabular data then a table is the correct structure.  However if you anre managing layout with a table then you are just creating maintenance problems for yourself. If it is a form, then rather than using styled divs you should use styled fieldsets for layout management to be semantically correct.

In any case, there is no reason to have the buttons as the final row of the table.  Put them in a container element outside the table and then you can position them any way you want using CSS.

Cd&
0
 

Author Closing Comment

by:breeze351
ID: 40308801
I awoke in the middle of the night.  "GOT IT!!!"  Just set a different <DIV> in the CSS.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question