How to create a table with out using table tag in css ?
7 2052 Dormilich 8,658
Recognized Expert Moderator Expert
not at all. first you don’t create HTML mark-up with CSS. second, the definition of a HTML table includes <table> tags. you could disguise other HTML mark-up to look like a table, but that doesn’t make it one (a list stays a list, no matter the look).
Well, actually, you can create a table-looking display with the CSS table properties but I've not messed with it yet.
Dormilich 8,658
Recognized Expert Moderator Expert
I didn’t say that you can’t create something that looks like a table , but that will not be a table.
Frinavale 9,735
Recognized Expert Moderator Expert
I remember playing with this once a long time ago....
I made a bunch of <div>s act like a table.
It wasn't worth the effort though and I'd recommend using a table if displaying tabular data.
Rabbit 12,516
Recognized Expert Moderator MVP
I think the point is that the OP wants to recreate the look of a table without using a table.
Yeah, I've done tables using div's and css as well. The biggest issue is that you have to be rigid with the widths if you don't want the layout changing all the time depending on the size of the browser window.
The whole kerfuffle against tables is mostly pointless in my opinion. I think the only point that is legitimate is that it isn't accessibility friendly. But I see no problem with using a table if you need it to display rows of data.
Tables are styled and laid out using the internal CSS of the browser.
But I see no problem with using a table if you need it to display rows of data.
Tables are a fixed, pre-defined grid that can't have things moved or changed easily, if at all. That's the problem with using them for layout.
Rabbit 12,516
Recognized Expert Moderator MVP
Yeah, but I wasn't talking about laying out a website using a table. Only using it for the display of rows of data, like a dataset from a database.
If you were to try to do so using pure css, it's a pain. You have to define the width of all the columns including the width of the parent container. Otherwise you get columns moving around all over the place. Having one field of data on top of another is just plain confusing. Then there's the problem of style formatting. The height of the cells don't match up so borders and background colors are different sizes. So now you have to define the height of the row container. But then you have to handle what happens when the data in the cell overflows the size you specified.
I find it easier to just use a table when I'm displaying the results of a query rather than trying to lay it out with pure css.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Anthony Williams |
last post by:
Good morning,
I'm currently designing a site, using CSS, and wish to create a variable
width two-column layout, with header and footer, and one fixed-width column
on the left.
Previously, I would have used a table to do this, using the following code:
<table width="100%">
|
by: Neal |
last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog
entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A
quite good article.
|
by: Rob Freundlich |
last post by:
I have some servlet-generated tabular data that I need to present, so I'm
using an HTML Table. In some cases, it can be quite large. I'm flushing
the servlet output every N lines to push the data to the browser as it
generates, and I've used "table-layout: fixed" for the table's CSS class.
It works pretty well in Netscape (7.1 and higher) - the table is drawn
pretty much as the rows are received by the browser. However, Internet...
|
by: Wayne Wengert |
last post by:
I have an aspx page I originzlly built in WebMatrix that includes a
"<table>" structure to layout the columns using "<tr>" and "<td>" elements
(see sample below). When I create a new aspx form in my VSNE2003 solution,
add a datalist component with table layout and paste that code, it doesn't
like the table related tags (<table>, <tr>, etc.). Using VSNET2003 what is
the correct way to specify the "table" layout (rows and columns)
...
|
by: Tom |
last post by:
Hi everyone,
I'm sure this gets asked a lot in different flavors, but I'm either
doing something wrong or this just won't work.
I'm trying to create a table that's the height of the browser viewport.
I wrote a test page like so:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
| |
by: greg.mckone |
last post by:
Hi folks,
I've been using CSS for style for several years now, but I've never
attempted a layout using CSS. (I'd like to move away from tables)
I'm working on a page here:
http://www.eurekacamp.ca/demo/contact.php
using the stylesheet here:
http://www.eurekacamp.ca/demo/Eureka.css
|
by: Roberto Roachling |
last post by:
Hello,
Converting a table layout to a div layout. The navbar is giving me
some trouble.
div link: http://gertrudischale.com/essay.pl.htm (slightly
incomplete, but illustrates problem)
table link:http://gertrudischale.com/_en/essay.htm
The images in the nav bar are slightly smaller in the div version. I
cant figure out why the last item in the nav bar wraps. The widths are
|
by: spacix |
last post by:
Does anyone know a work around for "table-layout: fixed;" to prevent the automatic evenly space cells width without assigning classes or ID to cells?
My program prints a HTML "report" file and I used "table-layout: fixed; width:691px;" because the reports have to be printed on 8.5x11 paper. I didn't want the table to resize or anything.
Then after I added that property to the table, the data cells no longer "fit to contents" even with a...
|
by: DBC User |
last post by:
I have a control panel and there I create a table layout panel and it
has dock as fill property. Now I add bunch of controls to them and
they get added successfully. It is good when there are few controls.
When I create 10 * 10 table on the fly, it creates them but they just
disappear outside my panels boundry. I have couple of questions.
1. How can I always create a control panel that adjust to the size of
panel when it is resized or...
|
by: Timothy Larson |
last post by:
I'm trying to create a 3 row layout in which each row will have two blocks,
BUT I want the width of these blocks to be independent of the blocks in the
other rows. So AFAICT a regular table layout is completely unsuitable.
I've been trying to recreate this idea with CSS for a couple hours now, using
positioned divs, but am not even close. (Maybe FF 1.5 is the problem?) Even
if I did manage to position the top and bottom rows within the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |