Is it still considered unwise to use tables for layout purposes?

After spending four frustrating hours attempting to vertically align text without resorting to tables, I had to throw in the towel.

I followed advice from a recommended solution on Stack Overflow, but my responsive layout requirements and complex CSS structure posed challenges that left me unable to make it work smoothly.

In the end, I had to give in and use a table to avoid wasting any more time. But it got me thinking - is there still a strong case against using tables for layout in certain situations, or has the landscape changed with modern design complexities?

EDIT:

CAN YOU SPOT THE HACK IN THIS CODE?

The method suggested in the link was labeled as a hack, which raises some concerns about its reliability.

<div class="greenBorder" style="display: table; height: 400px; #position: relative; overflow: hidden;">
    <div style=" #position: absolute; #top: 50%;display: table-cell; vertical-align: middle;">
      <div class="greenBorder" style=" #position: relative; #top: -50%">

However, it's worth noting that the traditional table approach always seems to do the job well.

<table>
<tr>
<td>
Text

Which option do you think looks cleaner? Trust your judgment!

Answer №1

Is it still necessary to steer clear of using tables for layout purposes?

Absolutely.

Has this perspective changed with the advancement in browser technology and the complexity of modern layouts?

The viewpoint has shifted as browsers now offer better support for CSS styling.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The web typography appears fuzzy or has incorrect thickness, lacks consistency across pages and even within a single page

The font (ProggyCleanSZBP.ttf from 1.1.5 release) appears to be intermittently thick and blurry. If you compare with , you'll notice that the latter displays as desired in most cases, but there are instances where the issue occurs, such as the first ...

What is the best way to add a button over an image using Tailwind CSS in Next.js?

I've been trying to display a button on top of an image using Tailwind CSS and Next.js, but I'm having trouble getting it to align properly. Here is the code snippet I've been working with: <div> <Image src={projectAiWrite ...

Firefox is not rendering HTML5 elements properly

While my website performs well in Chrome and Safari, there seems to be an issue with how elements are displayed in Firefox or IE. Some elements are being pushed to the right, and I am unsure of how to fix this problem. You can view the site here To aid i ...

Protected Bootstrap Environment

Bootstrap is an amazing tool, but it tends to enforce too many opinions. The selectors used in its rules are quite broad, such as input or label. Is there a method to isolate Bootstrap's CSS so that it only impacts elements within a container with a ...

Guide on emphasizing a div when the page's validity is not true

Is there a way to highlight a specific div when the page.isvalid=false? I can display the error message on page load, but struggling to highlight the required control. I have a JavaScript function that applies an error class to the div, which works fine w ...

Sequentially loading Bootstrap columns as the page loads

Is there a way to load columns one by one with a time gap when the page is loaded? Here's the code snippet that can achieve this: setTimeout(function() { $("#box1").removeClass("noDisplay"); },1000); setTimeout(function() { ...

Determining the cursor location within a character in a div that is content editable using AngularJS

I am facing challenges with obtaining the cursor caret position within a contenteditable div. Currently, I am utilizing the following function : onBlurArea (field, ev) { ev.preventDefault() const editable = ev.target.childNodes[1].childNodes[2] ...

Is it possible to automatically set focus on the input box in an html tag multiple times instead of just once with autofocus?

Currently, I am developing an online editor that allows users to quickly edit individual words. My approach involves replacing specific words with input boxes containing the word for direct editing by users. In order to streamline the process and ensure e ...

A guide on iterating through carousel elements using Vanilla JavaScript

I am currently extracting data from The Movie Database and I aim to showcase the retrieved information on my webpage using a carousel card with 3 slides. Here is a summary of my progress so far, html, <div class="details"><!--Movie deta ...

The Viadeo Social Toolbox seems to be encountering technical difficulties at the moment

I attempted to utilize a Viadeo Social Toolbox, specifically the Viadeo Share Button, but it seems to be malfunctioning in certain browsers? I came across some outdated viadeo share URLs like this: http://www.viadeo.com/shareit/share/?url=${url}&title ...

Centralized logo and slogan with Bootstrap 4 in navigation collapse

I am currently working on a Bootstrap 4 project that involves a navigation bar with a centered logo and tagline, along with links positioned to the left and right. While the setup is close to what I want, my ideal scenario would be for the logo to remain c ...

Is it possible for a complete CSS ".class" to possess the specificity of '!important'? [closed]

It's quite challenging to determine the exact inquiry being made here. This question lacks clarity, precision, completeness, specificity, and is overly general or rhetorical, making it impossible to answer in its current state. To obtain assistance in ...

Bootstrap Framework 3 causing horizontal scroll due to header styling

Here is the link you requested: This is the HTML Code: <header id="header-10"> </div><!-- /.header-10-top --> <!-- MAIN NAVIGATION --> <div class="header-10-main"> <div class="container"> ...

Is there a way to display the table on the same page following the submission of a form in HTML?

I am struggling with displaying a table on the same page after submitting a form that accepts a date picker as input and sends the value to the backend for processing. The response data from the backend needs to be inserted into the table. Below is the HTM ...

What is the best way to get input from a select box using Thymeleaf?

Recently, I've been working on a school project where I started learning Java Web/Spring/Bootstrap just a week ago. If any of my ideas are wrong, feel free to correct me. I was following an online tutorial and managed to fetch user input using Thymel ...

Create a stunning visual on the canvas using the high-resolution Retina display

Working on a web App in phonegap and trying to use a 320 by 480 image for drawing, but it appears fuzzy. html <canvas id="canvas" height=480 width=320> Your browser does not support the HTML5 canvas tag.</canvas> javascript var canvas = doc ...

Tips for aligning carousel indicators vertically in Bootstrap 5

I am struggling to vertically align the carousel indicators in Bootstrap 5. The solutions I have found so far are for Bootstrap 4, but they do not seem to work for me. Here is the markup for my carousel indicators. <div class='carousel-in ...

Is it possible to modify the CSS injected by an Angular Directive?

Is there a way to override the CSS generated by an Angular directive? Take, for instance, when we apply the sort directive to the material data table. This can result in issues like altering the layout of the column header. Attempting to override the CSS ...

Guide to making a basic cross-domain ajax request that fetches an HTML webpage

I have been researching various methods for making cross domain calls using ajax, but they all seem overly complex or too specific. Below is a basic HTML page where I am trying to send request parameters to a specific JSP on my server. <!DOCTYPE html&g ...

If the condition is based on the category in category.php and single.php

I am attempting to create a conditional statement that will display specific content only if the user is in a particular category or on a single.php page associated with that category. I have experimented with these codes, but unfortunately, neither of the ...