Can I Have One HTML Table Header Be Over Two Table Columns? Like ...
Có thể bạn quan tâm
-
- Home
- Questions
- Tags
- Users
- Companies
- Labs
- Jobs
- Discussions
- Collectives
-
Communities for your favorite technologies. Explore all Collectives
- Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Try Teams for free Explore Teams - Teams
-
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsGet early access and see previews of new features.
Learn more about Labs Can I have one HTML table header be over two table columns? Like merge and center in Excel? Ask Question Asked 12 years, 10 months ago Modified 7 years, 4 months ago Viewed 69k times 30I want to have one table header be centered over two table columns side by side. Is this possible?
Share Improve this question Follow edited Jul 11, 2017 at 8:49 Brian Tompsett - 汤莱恩 5,87572 gold badges60 silver badges133 bronze badges asked Jan 25, 2012 at 0:41 LizzaLizza 2,8195 gold badges41 silver badges73 bronze badges Add a comment |4 Answers
Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 58<th colspan="2">. This .</th>
To extrapolate a bit...
<table> <thead> <tr> <th>Single Column</th> <th colspan="2">Double Column</th> </tr> </thead> <tbody> <tr> <td>Column One</td> <td>Column Two</td> <td>Column Three</td> </tr> </tbody> </table>That should give you enough to work from.
Share Improve this answer Follow answered Jan 25, 2012 at 0:43 SpoonNZSpoonNZ 3,8291 gold badge21 silver badges25 bronze badges Add a comment | 11If you only have 2 columns then I would suggest using <caption>. Otherwise, use colspan as suggested in other answers.
<table> <caption>This will span all columns.</caption> <tr><td>column one</td><td>column two</td></tr> </table> Share Improve this answer Follow answered Jan 25, 2012 at 0:49 Travis JTravis J 82.2k42 gold badges211 silver badges279 bronze badges Add a comment | 5Of course. Please refer to this page. You are looking for attribute called colspan for table headers cells.
Share Improve this answer Follow answered Jan 25, 2012 at 0:45 Andrzej OśmiałowskiAndrzej Ośmiałowski 1,49412 silver badges21 bronze badges Add a comment | 4We can do it in better way.
<table border="1"> <tr> <th colspan="1" scope="colgroup">Test Heading</th> <th colspan="3" scope="colgroup">Mars</th> <th colspan="3" scope="colgroup">Venus</th> <th colspan="3" scope="colgroup">Test</th> </tr> <tr> <th rowspan="2"></th> <th scope="col">Produced</th> <th scope="col">Sold</th> <th scope="col">Sold</th> <th scope="col">Produced</th> <th scope="col">Sold</th> <th scope="col">Sold</th> <th scope="col">Test 1</th> <th scope="col">Test 2</th> <th scope="col">Test 3</th> </tr> </table>Please visit Table Ref From w3.org if you want to know more.
Share Improve this answer Follow edited May 17, 2017 at 7:39 Manfred Radlwimmer 13.4k13 gold badges54 silver badges64 bronze badges answered May 17, 2017 at 7:12 SrikrushnaSrikrushna 4,8372 gold badges43 silver badges49 bronze badges Add a comment |Your Answer
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Draft saved Draft discardedSign up or log in
Sign up using Google Sign up using Email and Password SubmitPost as a guest
Name EmailRequired, but never shown
Post Your Answer DiscardBy clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Not the answer you're looking for? Browse other questions tagged
or ask your own question.- The Overflow Blog
- The app that fights for your data privacy rights
- Your docs are your infrastructure
- Featured on Meta
- More network sites to see advertising test
- We’re (finally!) going to the cloud!
- Call for testers for an early access release of a Stack Overflow extension...
Linked
8 Merged Header Above a JTable Header in JavaRelated
1 Table headers inside main table header in HTML 11 How to include 2 columns under one column header in html table? 1 How can I make a HTML table with headers in one vertical column? 0 It is possible to make a vertical table with horizontal headers? 1 Create table with one header and then rows and columns below 0 Headers in table centered 0 Two table headers with multiple colspans 2 HTML: can a column span across both header and body rows? 0 Is there way to achieve inside the table header having a three table data? 0 HTML Table: Multiple header rows and columnHot Network Questions
- Moments of a random variable related to uniform distribution on sphere
- Is there an Order of Precedence in the three attributes of Christ the Saviour as mentioned in Jn 14:6?
- duplicate columns with AWK and separate them by tab
- H-bridge transistors are too hot
- How to attribute authorship to personal non-academic friend who made significant contributions
- Missile Impact Velocity
- Strange Brackets in String Writing
- What is the dating of Herod and Pompey's conquests of Jerusalem and the solemn fast
- Simplifying Exp[I Mod[x, 2π]] to Exp[I x]
- Can a storage device completely erase itself while performing the erase?
- In a Frequentist setting, how are we able to condition on the null hypothesis being True/False?
- C# basic calculator
- Why is the total energy of a bound system w.r.t to its COM less than zero?
- What is the origin of the term "Dog Character" in the context of fighting games?
- What is it called when you have a hobby where you're good enough at to impress others but you yourself know you're only beginning?
- Short story about a man living In an apartment who's curious about his neighbor who turns out to be a monster or demon
- In GR, what is Gravity? A force or curvature of spacetime?
- Testing Puzzles for Puzzle Book: Enigmatic Puzzle
- Path from plane
- Where in the Gospels does Jesus explain what 'The Truth' is?
- Why don't routers answer ARP requests for IP addresses they can handle even if they aren't assigned that IP address themselves?
- Do the surreal numbers enjoy the transfer principle in ZFC?
- Stable points in GIT: geometric picture
- Do longer papers have lower chances of being accepted because they take up more "space" in a journal issue (STEM)
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
lang-htmlTừ khóa » Html Table Th Two Columns
-
HTML Th Colspan Attribute - W3Schools
-
Table Cells That Span More Than One Column - W3Schools
-
Tables With Irregular Headers | Web Accessibility Initiative (WAI) | W3C
-
Table Rowspan And Colspan In HTML Explained (With Examples) »
-
How To Merge Table Columns In HTML? - Tutorialspoint
-
HTML |
Colspan Attribute - GeeksforGeeks How To Combine Or Merge Cells In An HTML Table - Computer Hope
HTML Table Basics - Learn Web Development | MDN
The Table Element - HTML: HyperText Markup Language | MDN
HTML5 Tables
Html Table With Two Columns And Two Rows Code Example
HTML Tables – Table Tutorial With Example Code - FreeCodeCamp
How To Create HTML Tables - Tutorial Republic
Tables And CSS Should Be Friendss
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu