Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5994481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:49:26+00:00 2026-05-22T23:49:26+00:00

On a web page that I am creating, I want to fill a rectangular

  • 0

On a web page that I am creating, I want to fill a rectangular area (let us say, the top half of the web page visible in a typical browser window) with about a hundred small rectangles:

  1. Each rectangle (let us call this a cell) has its own colour, some text written inside it, and a border which distinguishes it from its neighbours.
  2. The colour, shape and size of each cell, and the text which appears inside it is part of the input for making the web page : these depend on the user who is currently logged in, and changes periodically with time.

Given the data for all the hundred cells, how do I draw (and redraw) them on the web page? What technology should I use? HTML Tables/JavaScript/JQuery UI/HTML5 Canvas/ … ?

My background: I am reasonably comfortable with programming in general, but am not used to any of the newer technologies used for creating web pages, apart from basic html, some php, and JavaScript played by the ear. I will learn whatever is needed to get this done well.

Edit: In response to hamlin11’s question: The cells do not have any relationship to one another in general, except that they are guaranteed to fill the rectangular area. Here is an (imperfect) example of what they might look like, without the colours:
An example of the layout of cells, without the colours.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:49:27+00:00Added an answer on May 22, 2026 at 11:49 pm

    If this is a simple matter of drawing pre-calculated rectangles, I suggest using the HTML 5 Canvas.

    Here is an example that shows drawing rectangles

    I believe this is a good solution, because you can emit the HTML and javascript with whatever programming tool you are most comfortable with — and you don’t have to venture into javascript api’s.

    <canvas id="c1" width="200" height="200" style="border:solid 1px #000000;"></canvas>
    <button onclick="draw_square();return true;">Red Square</button> 
    <script>
      function draw_square() {
        var c1 = document.getElementById("c1");
        var c1_context = c1.getContext("2d");
        c1_context.fillStyle = "#f00";
        c1_context.fillRect(50, 50, 100, 100);
      }
     </script>
    

    References

    • Reference
    • http://www.tutorialspoint.com/html5/canvas_drawing_rectangles.htm
    • http://falcon80.com/HTMLCanvas/BasicShapes/Rectangle.html
    • http://vombat.tumblr.com/post/255461929/draw-rectangles-with-canvas-tag-in-html5
      • This link in particular should be helpful
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a web page, where I have an image that I want
I'm creating a form on a web page, but I want that form to
How to implement a web page that scales when the browser window is resized?
I am creating a web-page/website that integrates all my accounts into one spectrum, as
I am creating a login page for my web application. I want to create
I have a web page that includes a bunch of images. Sometimes the image
I've created a web page that lets you input some information and then draws
I have a web page that displays a long line graph inside a div
I have a simple web page that till now didn't need any login. It
I have a web page that is being displaying in a winform app using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.