Solved

Change # of columns and with in a table

Posted on 2014-09-06
4
111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 110

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

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.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

635 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