From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32068 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Borruso Newsgroups: gmane.text.pandoc Subject: HTML output: is there a way to style only one field of a pandas dataframe? Date: Mon, 23 Jan 2023 23:59:05 -0800 (PST) Message-ID: <41d93efd-6895-4ce9-b857-a97b00ff2fb5n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_220_1964612695.1674547145184" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24881"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDLLZEVS7UJBBSU7X2PAMGQE3B4B26I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jan 24 08:59:10 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f188.google.com ([209.85.167.188]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pKED0-0006LA-6B for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 24 Jan 2023 08:59:10 +0100 Original-Received: by mail-oi1-f188.google.com with SMTP id l1-20020aca1901000000b0036cd9d01876sf4147635oii.19 for ; Mon, 23 Jan 2023 23:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=LJEn4k9OMpQCN5zookvPf53JHDLfg5YQ9FDsdF3yiIg=; b=H+Xf6mCYe/+oUWNj26vtN0ctJOvVVXDbdeS0pwKKJYI8ymW0tp9ObFH1fIPq8+s2Zl belCvy0UggpNKh3j1BlpMH3vjN2GVtgyU9+GEUrdgDKm4ZRoZKIBonhEV8R0HBKumxqf Mhpfhu5ohUpT2M61tjsvKIuQJ/vOrJ/Oja57snLlmrIbbph0oxXEtz14sxJCuGXBt00w DrT51gmlA0XumLT2jr/A7i4JF6oWCGcR700R/07pFolzu+/EzfgBdNzjSu4UIb+Pq6yH SuyFDk5wVHltGr+z9H2oadWyHRRUKWxdiBSm5GVAKKiUfLNclq/W0B8xHoS7BeLRQ2Xa oY5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=LJEn4k9OMpQCN5zookvPf53JHDLfg5YQ9FDsdF3yiIg=; b=S62XOTx+qKYKDkoB+wS1nTIzk1lIQ6oKhD7yaG1zDPEJ8BTA9sdgNM5aekDrR8CeSw +ULTbs9HYwxzqcNlpBcmNEgigYeKavNfr1OfDKaaEJSTcqrJGhQrBDd50ndXshBwyDRN Rx6DXroPDfSL+vIArsvWZMdMS/PNlo8U7F8Sia4lBFQPlS/07G74qZsH3Qv+T811fiMH 0/TlOGo83q27Fe9BbmxBAk/hRVfTy6sFzOBtoO2YhU6lxnjFrqovcaPCVhR0hQBFqGw4 QsS6QHA0cVTwSMFWwQTx4ZXeBuPNFxpIi3gyQQimfI92VH3Mjgeu+IlSRbNZvDgiipBU A7QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:message-id:to:from:date :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=LJEn4k9OMpQCN5zookvPf53JHDLfg5YQ9FDsdF3yiIg=; b=WyqxqcoqjBi/KFpOoltF7CHDFJhuDhEVW1fMc13Rt6tvQpPNAEZAQUw80kiJwmfLMG mdvM5Hwfh/K8I83lzzru6oQKIl31VYNkbK2DYLeZNLjI0msGo2uBJaUILMaOhVHdgNP9 REjgGSLBctPN92Vzwi+0BTuhXUnQdtGtfTIkKtXzKveoSc/5eydK4QRKVi30PXITtfaG +83az0chB0OMM2tn+w7ynv9uT58HBDNzVpFvcxM8KDSbUsrqOWsoOoBBiY4+wX6dfTCw kNMsxY4F57iqwIuYY0a25qfi83lcurd8XJNEJBqGdhZN/NvMVaWLKgNeEyYfMuIqKvrm WFmg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kpvBGA4/FA25g+EMVj221viBxjQRfxN13k2pqDfCIGKmI1Bxjyg Q6HvLIJkjpAtX11cq9rKy9w= X-Google-Smtp-Source: AMrXdXugH2wRdvl1rGwi4AoVox1zuY5707vnByHum/xHqHpwIjx8ywNC38tuudMthMbf/Wk6IQh/1g== X-Received: by 2002:a05:6870:ac9a:b0:150:7fc3:e895 with SMTP id ns26-20020a056870ac9a00b001507fc3e895mr2059153oab.48.1674547149015; Mon, 23 Jan 2023 23:59:09 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:6703:b0:66d:a9f3:4e75 with SMTP id cr3-20020a056830670300b0066da9f34e75ls361169otb.9.-pod-prod-gmail; Mon, 23 Jan 2023 23:59:06 -0800 (PST) X-Received: by 2002:a9d:63d1:0:b0:684:af91:1239 with SMTP id e17-20020a9d63d1000000b00684af911239mr1318737otl.138.1674547145773; Mon, 23 Jan 2023 23:59:05 -0800 (PST) X-Original-Sender: aborruso-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32068 Archived-At: ------=_Part_220_1964612695.1674547145184 Content-Type: multipart/alternative; boundary="----=_Part_221_1872745013.1674547145184" ------=_Part_221_1872745013.1674547145184 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, if I use set_table_styles ```{python} #| echo: false #| warning: false import pandas as pd df =3D=20 pd.DataFrame({'text': ['foo', 'bar'],'number': [1, 2]}) dfStyler =3D=20 df.style.set_properties(**{'text-align': 'center'})=20 dfStyler.set_table_styles([dict(selector=3D'th', props=3D[('text-align',=20 'center')])]) ```=20 I have in jupyter notebook the style applied [image: image] But how to have in HTML output in example right align only for the number= =20 column? If I set it in this way: df.style.set_properties(subset=3D["number"], **{'text-align': 'right'})=20 it works in the notebook, but in quarto (rendered via pandoc) I have number= =20 column to aligned to the left [image: image] Is there a way to style only one field of a pandas dataframe? Thank you =E2=80=8B --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/41d93efd-6895-4ce9-b857-a97b00ff2fb5n%40googlegroups.com. ------=_Part_221_1872745013.1674547145184 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,
if I use set_table_styles

```{python} #| echo: false #| warning: false import pandas as pd df =3D pd.DataFrame({'text': ['foo', 'bar'],'number': [1, 2]}) dfStyler =3D df.style.set_properties(**{'text-align': 'center'}) dfStyler.set_table_styles([dict(selector=3D'th', props=3D[('text-align', 'c= enter')])]) ```

I have in jupyter notebook the style applied

3D"image"

But how to have in HTML output in example right align only for the number column?

If I set it in this way:

df.style.set_properties(subset=3D["number"], **{'text-align': '= right'})

it works in the notebook, but in quarto (rendered via pand= oc) I have number column to aligned to the left

3D"image"

Is there a way to style only one field of a pandas dataframe?

Thank you

=E2=80=8B

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/41d93efd-6895-4ce9-b857-a97b00ff2fb5n%40googlegroups.= com.
------=_Part_221_1872745013.1674547145184-- ------=_Part_220_1964612695.1674547145184--