Closed fortunewalla closed 1 year ago
Can you share the example as a qmd
document we can run on our side, with format and possible option used ? Thank you
Can you share the example as a
qmd
document we can run on our side, with format and possible option used ? Thank you
This is the folder from where I add and run everything:
https://github.com/fortunewalla/qq
This is the source URL of that exact document:
https://github.com/fortunewalla/qq/tree/main/posts/connectquerymssqlsasodbc
The document is also live at:
http://fortunewalla.net/qq/posts/connectquerymssqlsasodbc/
Thanks.
Oh I see now. This was asked once in https://github.com/quarto-dev/quarto-cli/discussions/2983 You can use CSS to control that.
You can also leverage bootstrap as HTML format is based on that.
Wrap your table in the desired class - see https://getbootstrap.com/docs/4.0/content/tables/#responsive-tables
::: {.table-responsive}
| **CustomerKey** | **GeographyKey** | **CustomerAlternateKey** | **Title** | **FirstName** | **MiddleName** | **LastName** | **NameStyle** | **BirthDate** | **MaritalStatus** | **Suffix** | **Gender** | **EmailAddress** | **YearlyIncome** | **TotalChildren** | **NumberChildrenAtHome** | **EnglishEducation** | **SpanishEducation** | **FrenchEducation** | **EnglishOccupation** | **SpanishOccupation** | **FrenchOccupation** | **HouseOwnerFlag** | **NumberCarsOwned** | **AddressLine1** | **AddressLine2** | **Phone** | **DateFirstPurchase** | **CommuteDistance** |
|-----------------|------------------|--------------------------|-----------|---------------|----------------|--------------|---------------|---------------|-------------------|------------|------------|----------------------------------|------------------|-------------------|--------------------------|----------------------|----------------------|---------------------|-----------------------|-----------------------|----------------------|--------------------|---------------------|---------------------|------------------|---------------------|-----------------------|---------------------|
| 11000 | 26 | AW00011000 | | Jon | V | Yang | 0 | 1970-04-08 | M | | M | jon24\@adventure-works.com | \$90,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 0 | 3761 N. 14th St | | 1 (11) 500 555-0162 | 2005-07-22 | 1-2 Miles |
| 11001 | 37 | AW00011001 | | Eugene | L | Huang | 0 | 1969-05-14 | S | | M | eugene10\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 2243 W St. | | 1 (11) 500 555-0110 | 2005-07-18 | 0-1 Miles |
| 11002 | 31 | AW00011002 | | Ruben | | Torres | 0 | 1969-08-12 | M | | M | ruben35\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 5844 Linden Land | | 1 (11) 500 555-0184 | 2005-07-10 | 2-5 Miles |
| 11003 | 11 | AW00011003 | | Christy | | Zhu | 0 | 1972-02-15 | S | | F | christy12\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 1825 Village Pl. | | 1 (11) 500 555-0162 | 2005-07-01 | 5-10 Miles |
| 11004 | 19 | AW00011004 | | Elizabeth | | Johnson | 0 | 1972-08-08 | S | | F | elizabeth5\@adventure-works.com | \$80,000.00 | 5 | 5 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 4 | 7553 Harness Circle | | 1 (11) 500 555-0131 | 2005-07-26 | 1-2 Miles |
| 11005 | 22 | AW00011005 | | Julio | | Ruiz | 0 | 1969-08-05 | S | | M | julio1\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 7305 Humphrey Drive | | 1 (11) 500 555-0151 | 2005-07-02 | 5-10 Miles |
| 11006 | 8 | AW00011006 | | Janet | G | Alvarez | 0 | 1969-12-06 | S | | F | janet9\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 2612 Berry Dr | | 1 (11) 500 555-0184 | 2005-07-27 | 5-10 Miles |
| 11007 | 40 | AW00011007 | | Marco | | Mehta | 0 | 1968-05-09 | M | | M | marco14\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 2 | 942 Brook Street | | 1 (11) 500 555-0126 | 2005-07-12 | 0-1 Miles |
| 11008 | 32 | AW00011008 | | Rob | | Verhoff | 0 | 1968-07-07 | S | | F | rob4\@adventure-works.com | \$60,000.00 | 4 | 4 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 3 | 624 Peabody Road | | 1 (11) 500 555-0164 | 2005-07-28 | 10+ Miles |
| 11009 | 25 | AW00011009 | | Shannon | C | Carlson | 0 | 1968-04-01 | S | | M | shannon38\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 3839 Northgate Road | | 1 (11) 500 555-0110 | 2005-07-30 | 5-10 Miles |
| 11010 | 22 | AW00011010 | | Jacquelyn | C | Suarez | 0 | 1968-02-06 | S | | F | jacquelyn20\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 7800 Corrinne Court | | 1 (11) 500 555-0169 | 2005-07-17 | 5-10 Miles |
| 11011 | 22 | AW00011011 | | Curtis | | Lu | 0 | 1967-11-04 | M | | M | curtis9\@adventure-works.com | \$60,000.00 | 4 | 4 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 4 | 1224 Shoenic | | 1 (11) 500 555-0117 | 2005-07-02 | 10+ Miles |
| 11012 | 611 | AW00011012 | | Lauren | M | Walker | 0 | 1972-01-18 | M | | F | lauren41\@adventure-works.com | \$100,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 1 | 2 | 4785 Scott Street | | 717-555-0164 | 2007-09-17 | 1-2 Miles |
| 11013 | 543 | AW00011013 | | Ian | M | Jenkins | 0 | 1972-08-06 | M | | M | ian47\@adventure-works.com | \$100,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 1 | 3 | 7902 Hudson Ave. | | 817-555-0185 | 2007-10-15 | 0-1 Miles |
| 11014 | 634 | AW00011014 | | Sydney | | Bennett | 0 | 1972-05-09 | S | | F | sydney23\@adventure-works.com | \$100,000.00 | 3 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 0 | 3 | 9011 Tank Drive | | 431-555-0156 | 2007-09-24 | 1-2 Miles |
:::
This should work for your need.
Also, I just checked our 1.3 prerelease includes some improvment regarding table, and bootstrap classes.
See https://quarto.org/docs/prerelease/1.3/tables.html#bootstrap-classes-can-be-added-to-tables
With 1.3 you can do that
| **CustomerKey** | **GeographyKey** | **CustomerAlternateKey** | **Title** | **FirstName** | **MiddleName** | **LastName** | **NameStyle** | **BirthDate** | **MaritalStatus** | **Suffix** | **Gender** | **EmailAddress** | **YearlyIncome** | **TotalChildren** | **NumberChildrenAtHome** | **EnglishEducation** | **SpanishEducation** | **FrenchEducation** | **EnglishOccupation** | **SpanishOccupation** | **FrenchOccupation** | **HouseOwnerFlag** | **NumberCarsOwned** | **AddressLine1** | **AddressLine2** | **Phone** | **DateFirstPurchase** | **CommuteDistance** |
|-----------------|------------------|--------------------------|-----------|---------------|----------------|--------------|---------------|---------------|-------------------|------------|------------|----------------------------------|------------------|-------------------|--------------------------|----------------------|----------------------|---------------------|-----------------------|-----------------------|----------------------|--------------------|---------------------|---------------------|------------------|---------------------|-----------------------|---------------------|
| 11000 | 26 | AW00011000 | | Jon | V | Yang | 0 | 1970-04-08 | M | | M | jon24\@adventure-works.com | \$90,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 0 | 3761 N. 14th St | | 1 (11) 500 555-0162 | 2005-07-22 | 1-2 Miles |
| 11001 | 37 | AW00011001 | | Eugene | L | Huang | 0 | 1969-05-14 | S | | M | eugene10\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 2243 W St. | | 1 (11) 500 555-0110 | 2005-07-18 | 0-1 Miles |
| 11002 | 31 | AW00011002 | | Ruben | | Torres | 0 | 1969-08-12 | M | | M | ruben35\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 5844 Linden Land | | 1 (11) 500 555-0184 | 2005-07-10 | 2-5 Miles |
| 11003 | 11 | AW00011003 | | Christy | | Zhu | 0 | 1972-02-15 | S | | F | christy12\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 1825 Village Pl. | | 1 (11) 500 555-0162 | 2005-07-01 | 5-10 Miles |
| 11004 | 19 | AW00011004 | | Elizabeth | | Johnson | 0 | 1972-08-08 | S | | F | elizabeth5\@adventure-works.com | \$80,000.00 | 5 | 5 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 4 | 7553 Harness Circle | | 1 (11) 500 555-0131 | 2005-07-26 | 1-2 Miles |
| 11005 | 22 | AW00011005 | | Julio | | Ruiz | 0 | 1969-08-05 | S | | M | julio1\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 7305 Humphrey Drive | | 1 (11) 500 555-0151 | 2005-07-02 | 5-10 Miles |
| 11006 | 8 | AW00011006 | | Janet | G | Alvarez | 0 | 1969-12-06 | S | | F | janet9\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 1 | 2612 Berry Dr | | 1 (11) 500 555-0184 | 2005-07-27 | 5-10 Miles |
| 11007 | 40 | AW00011007 | | Marco | | Mehta | 0 | 1968-05-09 | M | | M | marco14\@adventure-works.com | \$60,000.00 | 3 | 3 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 2 | 942 Brook Street | | 1 (11) 500 555-0126 | 2005-07-12 | 0-1 Miles |
| 11008 | 32 | AW00011008 | | Rob | | Verhoff | 0 | 1968-07-07 | S | | F | rob4\@adventure-works.com | \$60,000.00 | 4 | 4 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 3 | 624 Peabody Road | | 1 (11) 500 555-0164 | 2005-07-28 | 10+ Miles |
| 11009 | 25 | AW00011009 | | Shannon | C | Carlson | 0 | 1968-04-01 | S | | M | shannon38\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 3839 Northgate Road | | 1 (11) 500 555-0110 | 2005-07-30 | 5-10 Miles |
| 11010 | 22 | AW00011010 | | Jacquelyn | C | Suarez | 0 | 1968-02-06 | S | | F | jacquelyn20\@adventure-works.com | \$70,000.00 | 0 | 0 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 0 | 1 | 7800 Corrinne Court | | 1 (11) 500 555-0169 | 2005-07-17 | 5-10 Miles |
| 11011 | 22 | AW00011011 | | Curtis | | Lu | 0 | 1967-11-04 | M | | M | curtis9\@adventure-works.com | \$60,000.00 | 4 | 4 | Bachelors | Licenciatura | Bac + 4 | Professional | Profesional | Cadre | 1 | 4 | 1224 Shoenic | | 1 (11) 500 555-0117 | 2005-07-02 | 10+ Miles |
| 11012 | 611 | AW00011012 | | Lauren | M | Walker | 0 | 1972-01-18 | M | | F | lauren41\@adventure-works.com | \$100,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 1 | 2 | 4785 Scott Street | | 717-555-0164 | 2007-09-17 | 1-2 Miles |
| 11013 | 543 | AW00011013 | | Ian | M | Jenkins | 0 | 1972-08-06 | M | | M | ian47\@adventure-works.com | \$100,000.00 | 2 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 1 | 3 | 7902 Hudson Ave. | | 817-555-0185 | 2007-10-15 | 0-1 Miles |
| 11014 | 634 | AW00011014 | | Sydney | | Bennett | 0 | 1972-05-09 | S | | F | sydney23\@adventure-works.com | \$100,000.00 | 3 | 0 | Bachelors | Licenciatura | Bac + 4 | Management | Gestión | Direction | 0 | 3 | 9011 Tank Drive | | 431-555-0156 | 2007-09-24 | 1-2 Miles |
: {.responsive}
I believe this solves your issue. I'll close this.
Please do reopen if it is not complete.
I believe this solves your issue. I'll close this.
Please do reopen if it is not complete.
Thanks for the quick response.
I tried both of them again and both work. 👏🏼
I did try the : {.responsive}
tag before but for some some reason it didn't show up in the render.
Bug description
A markdown table does not have a horizontal scrollbar after rendering from a QMD document.
I tried my best in the docs and on Google Search and in other Github issues.
As seen below, the same table written in code blocks get a horizontal scrollbar automatically.
Is there any hack of doing so?
Win 10
The markdown table code I used.
The final render
Checklist
quarto check
so we know which version of quarto and its dependencies you're running.